Perl to Python Migration by Martin C. Brown

Perl to Python Migration by Martin C. Brown

Author:Martin C. Brown
Language: eng
Format: mobi, epub
Tags: Software Development, Java, Programming Languages, Python, JavaScript & VBScript, Computers, Programming, General, Perl (Computer program language), Internet, Object Oriented, Python (Computer program language), Perl, Web Page Design
ISBN: 9780201734881
Publisher: Addison-Wesley
Published: 2002-05-15T07:00:00+00:00


Class inheritance

Inheritance in Perl is handled through the @ISA array – module names appearing in the array are taken as classes from which we can inherit additional methods. With Python the process is more explicit – you list the classes from which you want to inherit at the time you define the class. For example if you want the class Citrus to inherit from the class Fruit:

class Citrus(Fruit): ...

The actual list of classes to inherit values from can be as long you like so that:

package Recipe; @ISA = qw/Fruit Vegetable Meat DryGoods/;

is equivalent to the Python:

class Recipe(Fruit, Vegetable, Meta, DryGoods):



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.